import 'jquery'
import 'element-ui/lib/theme-default/index.css'
import './vendor/jquery.cookie.js'

import AddressBook from './components/AddressBook.vue'
import App from './App.vue'
import Cart from './components/Cart.vue'
import CommodityDetailsPage from './components/CommodityDetailsPage.vue'
import ElementUI from 'element-ui'
import Header from './components/Header.vue'
import Index from './components/Index.vue'
import Login from './components/Login.vue'
import ModifyPassword from './components/ModifyPassword.vue'
import NewProduct from './components/NewProduct.vue'
import OrdersManager from './components/OrdersManager.vue'
import PaymentOrder from './components/PaymentOrder.vue'
import PersonalCenter from './components/PersonalCenter.vue'
import PersonalInformation from './components/PersonalInformation.vue'
import Register from './components/Register.vue'
import Show from './components/Show.vue'
import Validator from 'vue-validator'
import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'
import store from './store/index.js'

Vue.use(Vuex)
Vue.use(Validator)
Vue.use(VueRouter);
Vue.use(ElementUI);
Vue.component('my-header', Header);
const routes = [
    { path: '/Login', component: Login },
    { path: '/Index', component: Index },
    { path: '/Cart', component: Cart },
    { path: '/NewProduct', component: NewProduct },
    { path: '/PaymentOrder', component: PaymentOrder },
    { path: '/PersonalCenter', component: PersonalCenter },
    { path: '/PersonalCenter/Orders', component: OrdersManager },
    { path: '/PersonalCenter/PersonalInformation', component: PersonalInformation },
    { path: '/PersonalCenter/AddressBook', component: AddressBook },
    { path: '/PersonalCenter/ModifyPassword', component: ModifyPassword },
    { path: '/Show/:id', component: Show },
    { path: '/CommodityDetailsPage/:id', component: CommodityDetailsPage },
    { path: '/Register', component: Register }
]

// 3. 创建 router 实例，然后传 `routes` 配置
// 你还可以传别的配置参数, 不过先这么简单着吧。
const router = new VueRouter({
    routes // （缩写）相当于 routes: routes
});
new Vue({
    store,
    el: '#app',
    router,
    render: h => h(App)
}).$mount('#app')